﻿Public Class Launcher

    Public newPic As New List(Of InPicture)
    Public newInfo As New List(Of EasyInfo)
    Dim homepath As String = Application.UserAppDataPath

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Overlay.Show()
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        newPic.Add(New InPicture)
        newPic(newPic.Count - 1).Show()
        Label4.Text = newPic.Count
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        newInfo.Add(New EasyInfo)
        newInfo(newInfo.Count - 1).Show()
        Label5.Text = newInfo.Count
    End Sub

    Private Sub Launcher_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not (My.Computer.FileSystem.DirectoryExists(homepath & "\InPicture")) Then
            MkDir(homepath & "\InPicture")
        End If
        If Not (My.Computer.FileSystem.DirectoryExists(homepath & "\Overlay")) Then
            MkDir(homepath & "\Overlay")
        End If

        Dim sHTML As String = "<html><body style=""margin: 0px; padding: 2px;""><iframe src=""http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FStreamHelper%2F188193864550368&amp;layout=standard&amp;show_faces=true&amp;width=296&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=80"" scrolling=""no"" frameborder=""0"" style=""border:none; overflow:hidden; width:296px;"" allowTransparency=""true""></iframe></body></html>"
        If (Not (My.Computer.FileSystem.FileExists(homepath & "\fb.html"))) Or (ReadLine(homepath & "\fb.html", 1) <> sHTML) Then
            EditLine(homepath & "\fb.html", sHTML, 1)
        End If
        WebBrowser1.Url = New Uri(homepath & "\fb.html")
    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
        Shell("Explorer.exe " & "http://streamhelper.codeplex.com/", vbNormalFocus)
    End Sub

    Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click
        Shell("Explorer.exe " & homepath, vbNormalFocus)
    End Sub

    Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
        Shell("Explorer.exe " & "http://www.facebook.com/pages/StreamHelper/188193864550368", vbNormalFocus)
    End Sub

    Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
        WebBrowser1.Document.BackColor = SystemColors.Control
    End Sub
End Class
